package Thread;

public class ThreadDemo3 {
    public static void main(String[] args) {
        /*//第一种：继承Thread重新run方法
        Thread t1 = new MyThread1();
        Thread t2 = new MyThread2();
        //第二种：单独定义线程任务
        Runnable r2 = new MyRunnable2();
        Thread t3 = new Thread(r2);


        t1.start();
        t2.start();
        t3.start();*/










/*

        //1
        Runnable r2 =() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println("你是谁");
                }
            }
        };
        Thread t2 = new Thread(r2);
*/

        //2
        Thread r0 =new Thread(() -> {
            for (int i = 0; i < 1000; i++) {
                System.out.println("对对对");
            }
        });

        r0.start();
    }
}